

export default class BreakingMap {

    map = [];

    static mapLength = 12;

    constructor() {
        this.initLibaray();
        // console.log(this.map.length);
    }

    initLibaray() {
        let PlanetList;
        let FixedStarList;

        //白羊座
        PlanetList = {
            name: "Planet", num: 4, value: [
                { x: 160, y: -314, width: 100 },
                { x: 197, y: -69, width: 100 },
                { x: 144, y: 89, width: 100 },
                { x: -214, y: 410, width: 100 }]
        };
        FixedStarList = { name: "FixedStar", num: 0, value: [] };
        this.map.push({ 1: PlanetList, 2: FixedStarList });

        //天秤座
        PlanetList = {
            name: "Planet", num: 5, value: [
                { x: -194, y: 425, width: 90 },
                { x: -2, y: 357, width: 90 },
                { x: 250, y: 417, width: 90 },
                { x: 260, y: -22, width: 90 },
                { x: -122, y: -318, width: 90 }]
        };
        FixedStarList = {
            name: "FixedStar", num: 1, value: [
                { x: 26, y: 9, width: 100 }]
        };
        this.map.push({ 1: PlanetList, 2: FixedStarList });

        //巨蟹座
        PlanetList = {
            name: "Planet", num: 7, value: [
                { x: -282, y: 526, width: 90 },
                { x: -103, y: 260, width: 100 },
                { x: 7, y: 253, width: 100 },
                { x: -62, y: 126, width: 100 },
                { x: 63, y: 127, width: 100 },
                { x: -172, y: -305, width: 90 },
                { x: 306, y: 33, width: 90 }]
        };
        FixedStarList = { name: "FixedStar", num: 0, value: [] };
        this.map.push({ 1: PlanetList, 2: FixedStarList });

        //射手座    
        //简单
        PlanetList = {
            name: "Planet", num: 6, value: [
                { x: -71, y: 558, width: 90 },
                { x: -190, y: 418, width: 90 },
                { x: -23, y: -89, width: 90 },
                { x: -169, y: -175, width: 90 },
                { x: -23, y: -247, width: 90 },
                { x: 223, y: 33, width: 90 },
            ]
        };
        FixedStarList = {
            name: "FixedStar", num: 2, value: [
                { x: 61, y: 266, width: 90 },
                { x: 159, y: 418, width: 90 },

            ]
        };
        this.map.push({ 1: PlanetList, 2: FixedStarList });


        //水瓶座
        PlanetList = {
            name: "Planet", num: 5, value: [
                { x: 275, y: -175, width: 90 },
                { x: -97, y: -363, width: 90 },
                { x: -241, y: -96, width: 90 },
                { x: 35, y: 192, width: 90 },
                { x: -96, y: 494, width: 90 }]
        };
        FixedStarList = {
            name: "FixedStar", num: 2, value: [
                { x: -224, y: 170, width: 100 },
                { x: 105, y: -100, width: 100 }]
        };
        this.map.push({ 1: PlanetList, 2: FixedStarList });

        //摩羯座 普通
        PlanetList = {
            name: "Planet", num: 5, value: [
                { x: -267, y: 250, width: 90 },
                { x: 223, y: 443, width: 90 },
                { x: -160, y: 50, width: 90 },
                { x: 234, y: 236, width: 90 },
                { x: 201, y: -183, width: 90 }]
        };
        FixedStarList = {
            name: "FixedStar", num: 1, value: [
                { x: -2, y: 239, width: 120 }]
        };
        this.map.push({ 1: PlanetList, 2: FixedStarList });

        //双鱼座
        PlanetList = {
            name: "Planet", num: 5, value: [
                { x: -170, y: 483, width: 90 },
                { x: -279, y: 391, width: 90 },
                { x: 157, y: 40, width: 90 },
                { x: 244, y: 185, width: 90 },
                { x: -285, y: -362, width: 90 }]
        };
        FixedStarList = {
            name: "FixedStar", num: 3, value: [
                { x: -195, y: 250, width: 100 },
                { x: -43, y: -120, width: 100 },
                { x: 272, y: 76, width: 100 }]
        };
        this.map.push({ 1: PlanetList, 2: FixedStarList });

        //天蝎座
        PlanetList = {
            name: "Planet", num: 7, value: [
                { x: -217, y: 191, width: 90 },
                { x: -322, y: 70, width: 90 },
                { x: -254, y: -25, width: 90 },
                { x: -16, y: 127, width: 90 },
                { x: 111, y: 322, width: 90 },
                { x: 221, y: 539, width: 90 },
                { x: 301, y: 17, width: 90 }]
        };
        FixedStarList = {
            name: "FixedStar", num: 2, value: [
                { x: -138, y: -25, width: 100 },
                { x: 291, y: 360, width: 100 }]
        };
        this.map.push({ 1: PlanetList, 2: FixedStarList });

        //金牛座
        PlanetList = {
            name: "Planet", num: 6, value: [
                { x: -264, y: 310, width: 90 },
                { x: -82, y: 496, width: 90 },
                { x: 148, y: 250, width: 90 },
                { x: 89, y: 59, width: 90 },
                { x: 138, y: -40, width: 90 },
                { x: 301, y: -231, width: 90 }]
        };
        FixedStarList = {
            name: "FixedStar", num: 2, value: [
                { x: 181, y: -139, width: 100 },
                { x: -127, y: 164, width: 100 }]
        };
        this.map.push({ 1: PlanetList, 2: FixedStarList });

        //双子座 较难
        PlanetList = {
            name: "Planet", num: 6, value: [
                { x: 40, y: 564, width: 90 },
                { x: -310, y: 227, width: 90 },
                { x: -249, y: 106, width: 90 },
                { x: -92, y: -115, width: 90 },
                { x: 208, y: 218, width: 90 },
                { x: 298, y: 38, width: 90 }]
        };
        FixedStarList = {
            name: "FixedStar", num: 4, value: [
                { x: -9, y: 300, width: 90 },
                { x: -210, y: 214, width: 90 },
                { x: 76, y: 68, width: 90 },
                { x: 180, y: -136, width: 90 }]
        };
        this.map.push({ 1: PlanetList, 2: FixedStarList });

        //处女座 
        //普通
        PlanetList = {
            name: "Planet", num: 10, value: [
                { x: -101, y: 227, width: 90 },
                { x: -140, y: 425, width: 90 },
                { x: 1, y: 435, width: 90 },
                { x: -299, y: 104, width: 90 },
                { x: 159, y: 266, width: 90 },
                { x: 297, y: 150, width: 90 },
                { x: -53, y: -55, width: 90 },
                { x: -187, y: -345, width: 90 },
                { x: -95, y: -433, width: 90 },
                { x: 117, y: -298, width: 90 },
            ]
        };
        FixedStarList = {
            name: "FixedStar", num: 4, value: [
                { x: -91, y: 527, width: 90 },
                { x: -67, y: 333, width: 90 },
                { x: -87, y: -273, width: 90 },
                { x: 226, y: -65, width: 90 },

            ]
        };
        this.map.push({ 1: PlanetList, 2: FixedStarList });

        //狮子座   
        // 困难
        PlanetList = {
            name: "Planet", num: 7, value: [
                { x: -190, y: 559, width: 90 },
                { x: -105, y: 319, width: 90 },
                { x: 237, y: 573, width: 90 },
                { x: 300, y: 351, width: 90 },
                { x: -281, y: -195, width: 90 },
                { x: -126, y: -313, width: 90 },
                { x: 133, y: -289, width: 90 },
            ]
        };
        FixedStarList = {
            name: "FixedStar", num: 5, value: [
                { x: -292, y: 493, width: 90 },
                { x: -101, y: 425, width: 90 },
                { x: 223, y: 241, width: 90 },
                { x: -179, y: -217, width: 90 },
                { x: 229, y: -320, width: 90 },
            ]
        };
        this.map.push({ 1: PlanetList, 2: FixedStarList });
    }
    getMap(level) {
        if (level < this.map.length && level >= 0) {
            return this.map[level];
        }
        else {
            return this.map[this.map.length - 1];
        }

    }

    getLevelNum() {
        return this.map.length;
    }

}